/**
 * 
 */
package hihocoder;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 大富翁 {

	static class Node{
		Node parent;
		ArrayList<Node> childs=new ArrayList<>();
		int depth;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int N=scanner.nextInt();
		Node[] nodes=new Node[N+1];
		for (int i = 0; i < nodes.length; i++) {
			nodes[i]=new Node();
		}
		for (int i = 0; i < N; i++) {
			int next=scanner.nextInt()+i;
			next=Math.min(next, N);
			nodes[i].parent=nodes[next];
			nodes[next].childs.add(nodes[i]);
		}
		nodes[N].depth=0;
		initialNode(nodes[N]);//根节点
		int Q=scanner.nextInt();
		for (int i = 0; i < Q; i++) {
			int X=scanner.nextInt();
			if(X==1){
				int Y=scanner.nextInt()-1;//起始位置1-6
				System.out.println(nodes[Y].depth);
			}else if (X==2) {
				int u=scanner.nextInt()-1;
				int v=scanner.nextInt();//把Au改成v
				int next=Math.min(u+v,N);
				nodes[u].parent.childs.remove(nodes[u]);
				nodes[u].parent=nodes[next];
				nodes[u].depth=nodes[next].depth+1;
				nodes[next].childs.add(nodes[u]);
				initialNode(nodes[u]);//把它的子孙节点的深度改变
			}
		}
	}
	private static void initialNode(Node node) {
		ArrayList<Node> child=node.childs;
		for (Node node2 : child) {
			node2.depth=node.depth+1;
			initialNode(node2);
		}
	}
}
